<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>事件对象</title>
	</head>
	<body>
		<div class="wrapper" style="width:100px;height:100px ;background-color: red;">
		<div class="box" style="width:50px;height:50px ;background-color: orange;"></div>
		</div>
		<script type="text/javascript">
			var wrapper = document.getElementsByClassName("wrapper")[0];
			let box=document.getElementsByClassName("box")[0];
			/* IE是window.event，其他e */
			wrapper.onclick = function(e) {
				let event = e || window.event;
				/*事件源对象 IE是event.srcElement，其他e.target */
				let target=event.target||event.srcElement;
				console.log(target)
			}
		</script>
	</body>
</html>
